/**
 * 
 */
package recognition.processor;

import utility.math.Homotecia;
import utility.math.Vector2D;
import handwritten.character.HandWrittenCharacter;
import handwritten.gesture.Gesture;
import handwritten.gesture.MultiGesture;

/**
 * @author tioz
 *
 */
public class MatchLength extends Processor {

	
	/**
	 * 
	 */
	public MatchLength(MultiGesture target) {

	}

	/* (non-Javadoc)
	 * @see recognition.preprocessor.Preprocessor#preprocess(handwritten.gesture.MultiGesture)
	 */
	@Override
	protected boolean process(MultiGesture gest,HandWrittenCharacter target) {
		double rapport = target.getGesture().pathLength()/gest.pathLength();
		Homotecia homo = new Homotecia(gest.centerOfMass(),rapport);
		
		for(Gesture g : gest.getCollection())
		{
			for(Vector2D v : g.getPath())
			{
				homo.transform(v);
			}
		}
		
		return true;
	}

	

	
}
